#!/usr/bin/env python



import sys
Krange = range(11, 14)
Lrange = range(180, 250)
Rrange = range(14, 20)
c = {}
l = {}
for line in open(sys.argv[1]):
	if '>' in line:
		acc = line.strip()
		c[acc] = 0
		l[acc] = 0
	else:
		c[acc] += line.count('K')
		l[acc] += len(line.strip())
		
for acc in c.keys():
	if not c[acc]:
		continue
	if c[acc] in Krange and l[acc] in Lrange and l[acc]/c[acc] in Rrange:
		print acc, c[acc], l[acc], l[acc]/c[acc]

